/*
 * @Author: 张家亮 1690608011@qq.com
 * @Date: 2022-08-18 23:11:11
 * @LastEditors: 张家亮 1690608011@qq.com
 * @LastEditTime: 2022-08-20 10:58:50
 * @FilePath: \vue-store-server\app\middleware\RewriteUrl.js
 * @Description: 重写静态资源URL
 * 
 * Copyright (c) 2022 by 张家亮 1690608011@qq.com, All Rights Reserved. 
 */
module.exports = async (ctx, next) => {
  if (ctx.url.startsWith('/public')) {
    ctx.url = ctx.url.replace('/public', '');
  }
  await next();
}